﻿@model List<RentalSystem.Data.EF.MovieKinds>
           
@{
    ViewBag.Title = "MoviesCategories";
    Layout = "~/Views/Shared/WorkerLayout.cshtml";
}

<h2>MoviesCategories</h2>

@Html.ActionLink("Nowa kategoria", "MoviesCategoryAdd")

@if (Model != null)
{
    <table class="list">
        <thead>
            <tr>
                <td>Nazwa</td>
                <td>Skrót</td>
                <td></td>
                <td></td>
            </tr>
        </thead>

    @{int i = 0;}

    @foreach (RentalSystem.Data.EF.MovieKinds kind in @Model)
    {
        <tr class="odd">
        
            <th>@kind.MovieKindName</th>
            <td>@kind.MovieKindShortcut</td>
            
            <td>@Html.ActionLink("Edytuj","MoviesCategoryEdit",new {id=kind.MovieKindID})</td>
            <td>@Html.ActionLink("Usuń", "MoviesCategoryDelete", new { id = kind.MovieKindID , onclick = "return confirm('Na pewno skasować kategorię?');" })</td>
        </tr>
    }
    </table>
}